import http from "@/utils/request.ts";

const Api = {
  login: "/app/login",
  getUserInfo: "/app/getLoginUserInfo",
};

type loginData = {
  code: string;
};
/* 登录获取手机号*/
export function getPhoneApi(code: string) {
  return http.post(`/app/authorizationPhone/${code}`);
}

/* 登录获取用户信息*/
export function getUserInfo() {
  return http.post(Api.getUserInfo);
}

/* 登录*/
export function loginApi(data: loginData) {
  return http.post(Api.login, data, {
    custom: {
      noToken: true,
    },
  });
}
/* 登出*/
export function logout() {
  return http.post("/app/logout");
}
